<template>
  <div id="app">
    <!-- 顶部区域 -->
    <mt-header title="信息管理系统">
      <router-link to="/" slot="left">
        <mt-button icon="back">返回</mt-button>
      </router-link>
      <mt-button icon="more" slot="right"></mt-button>
    </mt-header>

    <!-- 路由区域 -->
    <router-view/>

  <!-- 底部区域 -->
    <mt-tabbar v-model="selected">
      <mt-tab-item id="index">
        <img slot="icon" src="./assets/logo.png">
        首页
      </mt-tab-item>
      <mt-tab-item id="vip">
        <img slot="icon" src="./assets/logo.png">
        VIP
      </mt-tab-item>
      <mt-tab-item id="shopping">
        <img slot="icon" src="./assets/logo.png">
        购物车
      </mt-tab-item>
      <mt-tab-item id="search">
        <img slot="icon" src="./assets/logo.png">
        搜索
      </mt-tab-item>
    </mt-tabbar>
  </div>
</template>

<script>
export default {
  name: 'App',
  data(){
    return {
      selected: '',
    }
  },
  watch: {
    selected(n_selected, o_selected){
      console.log(n_selected)
      this.$router.push({name: this.selected})
    }
  },
}
</script>

<style>
* {
  padding: 0px;
  margin: 0px;
}
</style>
